<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心--个人信息</title>
<script src="../../Public/Home/js/ymd.js" type="text/javascript"></script>
<script src="../../Public/Home/js/selarea.js" type="text/javascript"></script>
</head>

<body>
{include file='Public/login.html'}

<p><a href="{U('UserCenter/member')}">返回</a></p>


<form action="{U('UserCenter/modify_info')}" method="post" name="fromRegister" onsubmit="return register(this)">
<p>我的姓名：<input type="text" name="user_name" value="{$u_info.user_name}" /></p>
<p>电话号码：<input type="text" name="mobile_phone" value="{$u_info.mobile_phone}" /></p>
<p>性别:<input type="radio" name="sex" value="1" {if $u_info.sex == 1} checked="checked" {/if}/>男 
<input type="radio" name="sex" value="0" {if $u_info.sex == 0} checked="checked" {/if}>女</p>
<p>生日:{$u_info.birthday}
       <select name="bir_year" onChange="YYYYDD(this.value)">
	   <option value="">请选择 年</option>
	   </select>
	   <select name="bir_month" onChange="MMDD(this.value)">
	   <option value="">选择 月</option>
	   </select>
	   <select name="bir_day" onChange="DDD(this.value)">
	   <option value="">选择 日</option>
	   </select>
</p>
<p>地址：
    <span id="province">
      <select name="province" onChange="selProvinces(document.fromRegister.province.options[document.fromRegister.province.selectedIndex].value);">
      <option value="">请选择省份</option>
      {foreach from=$reg_list item=val}
      <option value="{$val.region_id}" {if $val.region_id == $u_info.province}selected{/if}>{$val.region_name}</option>
      {/foreach}
    </select>
    </span>
    <span id="city">
    <select name="city">
    <option value="" >请选择城市</option>
    {foreach from=$citys item=val}
    <option value="{$val.region_id}" {if $val.region_id == $u_info.city}selected{/if}>{$val.region_name}</option>
    {/foreach}
    </select>
    </span>
    <span id="district">
    <select name="district">
    <option value="">请选择区域</option>
    {foreach from=$districts item=val}
    <option value="{$val.region_id}" {if $val.region_id == $u_info.district}selected{/if}>{$val.region_name}</option>
    {/foreach}
    </select>
    </span>
</p>
<p>车辆号码：<input type="text" name="car_no" value="{$u_info.car_no}" /></p>
<input type="submit" name="modify_info" value="编 辑">
</form>
<script type="text/javascript">
	function register(form)
	{
		if(form.mobile_phone.value == "")
		{
			alert("请输入手机号码！");
			form.mobile_phone.select();
			return false;
		}
		if (form.mobile_phone.value.length>0)
		{
		    var reg = /^[\d|\-|\s]+$/;
		    if (!reg.test(form.mobile_phone.value))
		    {
		      alert("手机号码不是一个有效号码！");
		      form.mobile_phone.select();
			  return false;
		    }
		}
		if(form.user_name.value == "")
		{
			alert("请输入姓名！");
			form.user_name.select();
			return false;
		}
		if(form.car_no.value == "")
		{
			alert("请输入车牌号码！");
			form.car_no.select();
			return false;
		}
	}
</script>
</body>
</html>